package com.mtsmda.study.spring.spring_core.bean_basic;

import java.util.GregorianCalendar;

import com.mtsmda.study.spring.spring_core.di.FIO;

public class PersonInfo {

	private FIO fio;
	private GregorianCalendar dateOfBirth;
	private Character sex;

	public PersonInfo() {

	}

	public FIO getFio() {
		return fio;
	}

	public void setFio(FIO fio) {
		this.fio = fio;
	}

	public GregorianCalendar getDateOfBirth() {
		return dateOfBirth;
	}

	public void setDateOfBirth(GregorianCalendar dateOfBirth) {
		this.dateOfBirth = dateOfBirth;
	}

	public Character getSex() {
		return sex;
	}

	public void setSex(Character sex) {
		this.sex = sex;
	}

	public String getPersonInfo() {
		StringBuilder info = new StringBuilder();
		info.append(this.getFio().getFIO());
		info.append("    -      ");
		info.append(this.getDateOfBirth().get(GregorianCalendar.DAY_OF_MONTH));
		info.append(".");
		info.append(this.getDateOfBirth().get(GregorianCalendar.MONTH) + 1);
		info.append(".");
		info.append(this.getDateOfBirth().get(GregorianCalendar.YEAR));
		return info.toString();
	}
	
	@Override
	public String toString() {
		return getPersonInfo();
	}

}